package com.leonzhangxf.ioc.importation;

import org.springframework.context.annotation.Import;

import java.lang.annotation.*;

/**
 * The target annotation for start the hello configuration select process,
 * and supply a list of configuration.
 * <p>
 * Note: the demonstrate is just for showing how to use {@link org.springframework.context.annotation.ImportSelector}.
 * In actual use scenarios, this usually for load different infrastructure configuration bean by criterion.
 *
 * @author leonzhangxf
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
@Documented
@Import({HelloImportSelector.class})
public @interface EnableHello {

    /**
     * Given a {@link HelloEnum} to specify a list of configuration to be imported.
     *
     * @return the specified hello enum.
     */
    HelloEnum hello() default HelloEnum.HELLO_WORLD;
}
